 #define  _CRT_SECURE_NO_WARNINGS 1
/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */
 /**
  * Note: The returned array must be malloced, assume caller calls free().
  */

//int sizeroot(struct TreeNode* root)
//{
//    if (root == NULL)
//    {
//        return 0;
//    }
//    return sizeroot(root->left) + sizeroot(root->right) + 1;
//}
//void _preorderTraversal(struct TreeNode* root, int* x, int* i)
//{
//    if (root == NULL)
//    {
//        return;
//    }
//    x[(*i)++] = root->val;
//    _preorderTraversal(root->left, x, i);
//    _preorderTraversal(root->right, x, i);
//}
//int* preorderTraversal(struct TreeNode* root, int* returnSize)
//{
//    *returnSize = sizeroot(root);
//    int* a = (int*)malloc(*returnSize * sizeof(int));
//    int i = 0;
//    _preorderTraversal(root, a, &i);
//    return a;
//}